import protobuf
import os
import sys
import time

fd = os.open('file', os.O_WRONLY|os.O_CREAT)
f = protobuf.FileOutputStream(fd, 4)
c = protobuf.CodedOutputStream(f)
c.WriteLittleEndian32(101)
c.WriteLittleEndian64(12345678)
#f.Flush()


fd1 = os.open('file', os.O_RDONLY)
f1 = protobuf.FileInputStream(fd1)
c1 = protobuf.CodedInputStream(f1)
print(c1.ReadLittleEndian32())
print(c1.ReadLittleEndian64())

import protobuf
import os
fd = os.open('file', os.O_WRONLY|os.O_CREAT)
f = protobuf.FileOutputStream(fd, 4)
print(f.Next())
